<?php
session_start();
require('../config.php');
if(isset($_SESSION[sess_login])){
	$permission = $_SESSION[sess_login]['permission'];
	if($permission =='2' || $permission =='3' ){
		include("../connect.php");
		$array_list = '';
		$command = "SELECT `user_account`.`id`, `user_account`.`username`, `user_account`.`permission`, `user_account`.`status`,`user_info`.`fullname`, `user_info`.`address`, `user_info`.`email`, `user_info`.`phonenumber`, `user_info`.`birthday`, `user_info`.`avatar` FROM `user_account`,`user_info` WHERE `user_account`.`id` = `user_info`.`id`";
		$result = mysql_query($command, $conn);
		if (@mysql_num_rows($result)!=0){
			while ($row = mysql_fetch_row($result)){
				$array_list[] = $row;
			}
		}
		mysql_free_result($result);
		mysql_close($conn);
		
		echo '{"aaData":'.json_encode($array_list).'}';

	}
	else {
		echo '<center><br /><br />You are not permission</center>';
	}
}
else {
	echo '<center><br /><br />Please Login</center>';
}
?>